﻿using System;
using System.Configuration;

namespace NCommet.Core.Configuration
{
    /// <summary>
    /// Configuration section for NCommet.
    /// </summary>
    public class NCommetCfgSection : ConfigurationSection
    {
        /// <summary>
        /// The fully qualified name of a type that implements <see cref="NCommet.Core.Agents.IPersister"/>
        /// </summary>
        [ConfigurationProperty("persister")]
        public string Persister { get { return this["persister"] as string; } }

        /// <summary>
        /// The fully qualified name of a type that implements <see cref="NCommet.Core.Agents.ISorter"/>
        /// </summary>
        [ConfigurationProperty("sorter")]
        public string Sorter { get { return this["sorter"] as string; } }

        /// <summary>
        /// The fully qualified name of a type that implements <see cref="NCommet.Core.Agents.ISearcher"/>
        /// </summary>
        [ConfigurationProperty("searcher")]
        public string Searcher { get { return this["searcher"] as string; } }

        /// <summary>
        /// The fully qualified name of a type that implements <see cref="NCommet.Core.Agents.ITypedTreeValidator"/>
        /// </summary>
        [ConfigurationProperty("typedTreeValidator")]
        public string TypedTreeValidator { get { return this["typedTreeValidator"] as string; } }

        /// <summary>
        /// The fully qualified name of a type that implements <see cref="NCommet.Core.Agents.IDaoEventsSink"/>
        /// </summary>
        [ConfigurationProperty("daoEventsSink")]
        public string DaoEventsSink { get { return this["daoEventsSink"] as string; } }

        /// <summary>
        /// The fully qualified name of a type that implements <see cref="NCommet.Core.Agents.IWhoAmI"/>
        /// </summary>
        [ConfigurationProperty("whoAmI")]
        public string WhoAmI { get { return this["whoAmI"] as string; } }

        /// <summary>
        /// The fully qualified name of a type that implements <see cref="NCommet.Core.Agents.IAuthorizationManager"/>
        /// </summary>
        [ConfigurationProperty("authorizationManager")]
        public string AuthorizationManager { get { return this["authorizationManager"] as string; } }

        /// <summary>
        /// A collection of modules.
        /// </summary>
        [ConfigurationProperty("modules")]
        public ModuleCfgCollection Modules { get { return this["modules"] as ModuleCfgCollection; } }
    }
}
